package cn.tqfeiyang.smartadmin.office.entity;

import java.time.LocalDateTime;

import cn.tqfeiyang.smartadmin.commons.mybatis.EntityMapping;
import cn.tqfeiyang.smartadmin.office.constant.PriorityEnum;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.experimental.FieldNameConstants;

/**
 * 通知实体
 *
 * @author tqfeiyang
 * @since 2024-09-04
 */
@Data
@FieldNameConstants
@TableName("oa_notice")
public class NoticeEntity {

    /**
     * 通知id
     */
    @TableId(value = "notice_id", type = IdType.AUTO)
    private Long noticeId;

    /**
     * 分类id
     */
    @TableField(value = "category_id")
    private Long categoryId;

    /**
     * 通知分类
     */
    @TableField(exist = false)
    @EntityMapping(thisField = "categoryId")
    private NoticeCategoryEntity category;

//    /**
//     * 管理员id
//     */
//    @TableField(value = "manager_id")
//    private Long managerId;
//
//    /**
//     * 管理员
//     */
//    @TableField(exist = false)
//    @EntityMapping(thisField = "managerId", joinField = "userId")
//    private UserEntity manager;

    /**
     * 标题
     */
    @TableField(value = "title")
    private String title;

    /**
     * 内容
     */
    @TableField(value = "content")
    private String content;

    /**
     * 优先级
     */
    @TableField(value = "priority")
    private PriorityEnum priority;

    /**
     * 排序
     */
    @TableField(value = "sort")
    private Integer sort;

    /**
     * 创建时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    /**
     * 修改时间
     */
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

}